package com.sharding.demo.controller;

import com.sharding.demo.entity.Goods;
import com.sharding.demo.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController()
@RequestMapping("/goods")
public class GoodsController {
 
    @Autowired
    private GoodsService GoodsService;
 
    @GetMapping("/select")
    public List<Goods> select() {
        return GoodsService.getBaseMapper().selectList(null);
    }

    @GetMapping("/insert")
    public Boolean insert(Goods Goods) {
        return GoodsService.save(Goods);
    }

}